
#undef TABLE_START
#undef TABLE_END
#undef _TABLE_FIELD
#undef TABLE_FIELD_INT
#undef TABLE_FIELD_LNG
#undef TABLE_FIELD_STR
#undef TABLE_FIELD_DBL
#undef TABLE_FIELD_BIN



#define _TABLE_GETDEF(t)					Table_ ## t* __tbl = Table_ ## t::getStaticDef();
#define _TABLE_OPEN(t)						DB::openTable(__tbl);



#define _TABLE_FIELD(t,type,name,len)		__tbl->registerField(&__tbl->name,#name,type,len);


#define TABLE_FIELD_INT(t,field)			_TABLE_FIELD(t,TFT_INT,field,4)
#define TABLE_FIELD_LNG(t,field)			_TABLE_FIELD(t,TFT_LNG,field,8)
#define TABLE_FIELD_DBL(t,field)			_TABLE_FIELD(t,TFT_DBL,field,8)
#define TABLE_FIELD_STR(t,field,size)		_TABLE_FIELD(t,TFT_STR,field,size)



#define TABLE_START(t)						{ _TABLE_GETDEF(t) TABLE_FIELD_LNG(t,id)
#define TABLE_END(t)						_TABLE_OPEN(t) }

